﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kokomo.Environment.Commanding;
using System.Windows.Input;

namespace Kokomo.Environment.Hosting
{
	class RecentDocumentMenuItemViewModel : MenuItemViewModel
	{
		public RecentDocumentEntry Entry { get; private set; }
		public ICommand OpenDocumentCommand { get; private set; }

		public RecentDocumentMenuItemViewModel(
			RecentDocumentEntry entry,
			ICommand openDocumentCommand
			)
		{
			if (entry == null) throw new ArgumentNullException("entry");
			if (openDocumentCommand == null) throw new ArgumentNullException("openDocumentCommand");

			this.Entry = entry;
			this.OpenDocumentCommand = openDocumentCommand;
		}

		public override UiString Text
		{
			get { return UiString.FromString(this.Entry.DocumentPath); }
		}
		public override ICommand Command
		{
			get
			{
				return this.OpenDocumentCommand;
			}
		}
		public override object CommandArgument
		{
			get
			{
				return this.Entry.DocumentPath;
			}
		}
	}
}
